.w-row.card.reward-card.card-terciary.u-marginbottom-20.card-edition
  .w-col.w-col-4.w-sub-col
    .fontweight-semibold.fontsize-smallest.u-marginbottom-10
      - if resource.new_record?
        | #{t('.reward')} #
        span.custom-f-reward-counter= parent.rewards.count + 1
      - else
        = t('.edit')
      |&nbsp;
      a.link-edit.fa.fa-question-circle href="#"
    .fontsize-smallest.fontcolor-secondary.reward-explanation.w-hidden.u-marginbottom-20= t('.info_box')
  .w-col.w-col-8
    .card
      .w-form
        = simple_form_for [parent, resource], html: { id: 'project_reward_form' }, remote: true do |form|
          = render 'devise/shared/alert'
          .w-row.u-marginbottom-20
            .w-col.w-col-5
              label.fontsize-smaller= t('.minimum_value') 
            .w-col.w-col-7
              .w-row
                .w-col.w-col-3.w-col-small-3.w-col-tiny-3.text-field.positive.prefix.no-hover
                  .fontsize-smallest.fontcolor-secondary.u-text-center R$
                .w-col.w-col-9.w-col-small-9.w-col-tiny-9
                  = form.input_field :minimum_value, class: 'postfix positive', required: true
              .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="reward_minimum_value"] = t('simple_form.validation_texts.reward.minimum_value')
          .w-row
            .w-col.w-col-5
              label.fontsize-smaller= t('.deliver_at') 
            .w-col.w-col-7
              .w-row
                .w-col.w-col-6.w-sub-col.deliver-at-date
                  = form.input_field :deliver_at, required: true, as: :date, discard_day: true, start_year: Time.current.year, use_short_month: true, discard_day: true, required: true
          .w-row
            .w-col.w-col-5
              label.fontsize-smaller= t('.description') 
            .w-col.w-col-7
              = form.input_field :description, as: :text,  class: 'positive', placeholder: "Descreva sua recompensa", required: true
              .fontsize-smaller.text-error.u-marginbottom-20.fa.fa-exclamation-triangle.w-hidden[data-error-for="reward_description"] = t('simple_form.validation_texts.reward.description')
          .w-row
            .w-col.w-col-5
              .w-checkbox
                .w-checkbox-input= check_box_tag  "limit_reward", '', (resource.maximum_contributions.present?), id: 'limit_reward' 
                label.w-form-label for="limit_reward"= t('.limit_reward') 
            .w-col.w-col-7 class="#{ resource.maximum_contributions.present? ?  '' : 'w-hidden'}"
              = form.input_field :maximum_contributions, class: 'u-marginbottom-30 positive', placeholder: t('.available')
          .w-row
            .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
              = form.button :submit, t('.submit'),  class:'btn btn-small'
            .w-col.w-col-5.w-col-small-5.w-col-tiny-5.w-sub-col-middle
              input.w-button.btn-terciary.btn.btn-small.reward-close-button type="submit" value="Fechar" 
            - if resource.persisted? && policy(resource).destroy?
              .w-col.w-col-1.w-col-small-1.w-col-tiny-1
                = link_to [parent, resource], method: :delete, data: {confirm: 'Tem certeza?'} do
                  .btn.btn-small.btn-terciary.fa.fa-lg.fa-trash.btn-no-border
